Skip to content

INSTALLED_APPS duplicate-registration guard#153

Merged
wpak-ai merged 1 commit into
cppalliance:developfrom
whisper67265:fix/app-duplication-guard
Jul 1, 2026
Merged

INSTALLED_APPS duplicate-registration guard#153
wpak-ai merged 1 commit into
cppalliance:developfrom
whisper67265:fix/app-duplication-guard

Conversation

@whisper67265

@whisper67265 whisper67265 commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Close #151.

Summary by CodeRabbit

  • Bug Fixes
    • Prevented duplicate application of the Boost endpoint configuration when settings overrides are applied more than once.
    • Improved startup behavior so initialization runs only once, avoiding repeated ready-time effects.
  • Tests
    • Added coverage for repeated settings override execution with both list and tuple settings formats.
    • Added an end-to-end check to confirm setup still completes with a single initialization call.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c300f79f-51f3-4918-a3b2-22246be2b3c6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a membership check in settings_override.py so that _ENDPOINT_APP_CONFIG is only appended to INSTALLED_APPS if not already present, preventing duplicates on repeated exec. Two new tests verify this: one parameterized unit test for list/tuple inputs, and one subprocess test asserting BoostEndpointConfig.ready is invoked exactly once.

INSTALLED_APPS idempotency guard

Layer / File(s) Summary
Duplicate-entry guard
src/boost_weblate/settings_override.py
Tightens the INSTALLED_APPS mutation guard to also check that _ENDPOINT_APP_CONFIG is not already present before appending.
Idempotency tests
tests/test_settings_override.py
Adds _exec_settings_override helper, a parameterized test for list/tuple INSTALLED_APPS deduplication, and a subprocess test that patches BoostEndpointConfig.ready to confirm single invocation after double execution.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • cppalliance/cppa-weblate-plugin#48: Related through BoostEndpointConfig URL registration — the subprocess test here verifies ready() (introduced in that PR) fires only once when the override is applied twice.

Suggested reviewers

  • henry0816191

🐇 A bunny once stuffed the same app twice,
And Django said "No, that's not nice!"
Now a check guards the list,
No duplicates missed —
One ready() call, crisp and precise! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: preventing duplicate INSTALLED_APPS registration.
Linked Issues check ✅ Passed The changes add an idempotency guard and tests that prevent duplicate endpoint app registration for #151.
Out of Scope Changes check ✅ Passed The added tests and guard are directly tied to the duplicate-registration fix, with no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@whisper67265

Copy link
Copy Markdown
Collaborator Author

@coderabbitai, review

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

@whisper67265 Reviewing the changes in #153 now.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@whisper67265 whisper67265 requested a review from wpak-ai July 1, 2026 18:13
@wpak-ai wpak-ai merged commit e90cdba into cppalliance:develop Jul 1, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

INSTALLED_APPS duplicate-registration guard

3 participants